package org.fsconnector.cci;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

import javax.resource.ResourceException;
import javax.resource.cci.LocalTransaction;

public interface FSConnection {

	public void close();

	public void copy(FSFile from, FSFile to) throws IOException;

	public void copy(FSFile from, FSFile to, boolean append) throws IOException;

	public FSFile getFile(String filename);

	public FSFile getFile(FSFile parent, String filename);

	public LocalTransaction getLocalTransaction() throws ResourceException;

//	public FSFile[] listFiles();

//	public FSFile[] listFiles(FilenameFilter filter);

	public InputStream openInputStream(String filename) throws FileNotFoundException;

	public InputStream openInputStream(FSFile file) throws FileNotFoundException;

	public OutputStream openOutputStream(String filename) throws IOException;

	public OutputStream openOutputStream(String filename, boolean append) throws IOException;

	public OutputStream openOutputStream(FSFile file) throws IOException;

	public OutputStream openOutputStream(FSFile file, boolean append) throws IOException;

	public Reader openReader(String filename) throws FileNotFoundException;

	public Reader openReader(FSFile file) throws FileNotFoundException;

	public Writer openWriter(String filename) throws IOException;

	public Writer openWriter(String filename, boolean append) throws IOException;

	public Writer openWriter(FSFile file) throws IOException;

	public Writer openWriter(FSFile file, boolean append) throws IOException;

}
